with open("gb2312.txt", "rb") as f:
    s = f.read()

arr = bytearray(s)

i = 0
j = 0

for ch in arr:
    i += 1
    if i % 2 == 0:
        j += 1
        if j % 8 == 0:
            end = "\n"
        else:
            end = " "
    else:
        end = ""

    print("%02x" % ch, end=end)

print()
